﻿<extend name="Public:office" />
<block name="title"><title>任务管理</title></block>
<block name="header_styles">
    <link href="__Public__/js/kendo.ui/kendo.bootstrap.min.css" rel=" stylesheet" />
    <link href="__Public__/js/kendo.ui/kendo.common-bootstrap.min.css" rel=" stylesheet" />
    <script type="text/javascript" src="__Public__/js/kendo.ui/cultures/kendo.culture.zh-CN.min.js"></script>
</block>
<block name="main">
    <div class="task-container">
        <ul class="task-menu">
            <li><a href="{:U('/Task/main')}">任务管理</a></li>
            <li>  |  </li>
            <li class="active"><a href="javascript:void(0);">任务统计</a></li>
        </ul>
        <div class="task-body" style="border:none;">
            <br />
            <div class="task-total text-center">
                <div>Total</div>
                {$total}
            </div>
            <br /><br />
            <div class="row">
                <div class="col-sm-3">
                    <div class="task-summary">
                        <canvas id="myCanvas1" width="210" height="210"></canvas>
                        <div class="task-total text-center radius-counter" data-targetid="myCanvas1" data-percent="{$notDone/$total*100|intval}">
                            {$notDone}
                            <div>未开始</div>
                        </div>
                        <ul>
                            <volist name="notDoneTasks" id="vo">
                                <li>
                                    <a href="/Task-main.html#{$vo.id}">
                                        <if condition="$uid eq $vo['exer']">
                                            <span>【执行】</span>
                                            <elseif condition="$uid eq $vo['fromwho']" />
                                            <span>【发布】</span>
                                            <elseif condition="in_array($uid,$vo['cc'])" />
                                            <span>【抄送】</span>
                                            <else />
                                            <span>【其他】</span>
                                        </if>
                                        {$vo.title}
                                    </a>
                                </li>
                            </volist>
                            <!--<li><a href="#"><span>【执行】</span>首页原型设计首页原型设计首页原型设计</a></li>
                            <li><a href="#"><span>【发布】</span>首页原型设计首页原型设计首页原型设计</a></li>
                            <li><a href="#"><span>【抄送】</span>首页原型设计首页原型设计首页原型设计</a></li>-->
                        </ul>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="task-summary">
                        <canvas id="myCanvas2" width="210" height="210"></canvas>
                        <div class="task-total text-center radius-counter" data-targetid="myCanvas2" data-percent="{$processing/$total*100|intval}">
                            {$processing}
                            <div>进行中</div>
                        </div>
                        <ul>
                            <volist name="processingTasks" id="vo">
                                <li><a href="/Task-main.html#{$vo.id}"><span>【执行】</span>{$vo.title}</a></li>
                            </volist>
                        </ul>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="task-summary">
                        <canvas id="myCanvas3" width="210" height="210"></canvas>
                        <div class="task-total text-center radius-counter" data-targetid="myCanvas3" data-percent="{$submitted/$total*100|intval}">
                            {$submitted}
                            <div>已提交</div>
                        </div>
                        <ul>
                            <volist name="submittedTasks" id="vo">
                                <li><a href="/Task-main.html#{$vo.id}"><span>【执行】</span>{$vo.title}</a></li>
                            </volist>

                        </ul>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="task-summary">
                        <canvas id="myCanvas4" width="210" height="210"></canvas>
                        <div class="task-total text-center radius-counter" data-targetid="myCanvas4" data-percent="{$completed/$total*100|intval}">
                            {$completed}
                            <div>已验收</div>
                        </div>
                        <ul>
                            <volist name="completedTasks" id="vo">
                                <li><a href="/Task-main.html#{$vo.id}"><span>【执行】</span>{$vo.title}</a></li>
                            </volist>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="footer_scripts">

    <script type="text/x-kendo-template" id="tplAddNewTask">
        <div class="task-details">
            <form method="post" onsubmit="return onAddNewTaskSubmit()" id="formAddNewTask">
                <div class="task-details-heading">
                    执行者:
                    <select class="task-dropdown" style="width:70px;" name="executor" id="executor">
                        <option>叉叉</option>
                    </select>
                    抄送:
                    <select id="selCC" name="cc" style="width:130px;"></select>
                    截止期:
                    <input type="text" class="task-input required date" id="txtExpires" />
                    <label class="label-priority">加急 &nbsp;<input type="checkbox" /></label>

                </div>
                <div class="task-details-title">
                    <input type="text" class="form-control required" name="title" id="title" placeholder="任务标题..." />
                </div>
                <div class="task-details-content">
                    <textarea id="taskcontent" name="taskcontent" class="form-control required" rows="10" placeholder="任务描述..."></textarea>
                </div>
                <div class="task-buttons text-center">
                    <button type="submit">发布</button>
                </div>
            </form>
        </div>
    </script>
    <script type="text/javascript">
        require(["jquery"], function ($) {
            $(".radius-counter").each(function () {
                var targetId = $(this).data("targetid");
                var current = $(this).data("percent") / 100;
                var c = document.getElementById(targetId);
                var canvas2d = c.getContext("2d");
                canvas2d.beginPath();
                canvas2d.arc(100, 100, 58, -0.5 * Math.PI, current * (2 * Math.PI) - Math.PI / 2, false);
                canvas2d.fillStyle = "#42b866";
                canvas2d.lineTo(100, 100);
                canvas2d.fill();
                canvas2d.closePath();
            });
        });
    </script>
</block>
